<?php
namespace app\user\service\user;

use app\common\service\BaseService;
use think\facade\Request;
use app\common\exception\LogicException;
use app\user\logic\user\Question as QuestionLogic;

/**
 * 提问接口
 */
class Question extends BaseService
{

	/**
     * 添加提问
     */
	public function addQuestion()
	{
		$param = Request::post();
		$data  = app(QuestionLogic::class)->addQuestion($param);

		return $this->parseToData($data, 1, '提问成功');
	}

    /**
     * 添加提问回复
     */
	public function addQuestionReply()
	{
		$param = Request::post();
		$data  = app(QuestionLogic::class)->addQuestionReply($param);

		return $this->parseToData($data, 1, '回复成功');
	}

	/**
	 * 获取用户提问对话框
	 */
	public function getQuestionCommunication(int $id)
	{
        $param = Request::get();
		$data = app(QuestionLogic::class)->getQuestionCommunication($id,$param);

		return $this->parseToData($data, 1, '获取成功');
	}

}
